package com.trafficsys.modules.loginAndRegister.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.trafficsys.modules.entity.Driver;
import com.trafficsys.modules.entity.Police;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @Author Zhao Bin
 * @Date 2021/9/27 10:29
 * @Version 1.0
 */
@Mapper
@Repository
public interface PoliceDao extends BaseMapper<Police> {
    //police电话号码登录
    @Select("select * from police where phone = #{phone} and password = #{password}")
    Police loginByPhone(@Param("phone")String phone, @Param("password")String password);
    //police身份证号码登录
    @Select("select * from police where card_id = #{cardId} and password = #{password}")
    Police loginByCardId(@Param("cardId")String cardId, @Param("password")String password);
    //police根据phone查询用户
    @Select("select * from police where phone = #{phone}")
    Police getPoliceByPhone(@Param("phone")String phone);
    @Select("select * from police where card_id = #{cardId}")
    Police getPoliceByCardId(String cardId);
}
